package org.struts.mvc.action.user;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.struts.mvc.action.Action;
import org.struts.mvc.action.form.ActionForm;

public class UserAction implements Action{

	public String execute(HttpServletRequest request, ActionForm form, Map<String, String> forwardMap)
			throws Exception {
		
		UserForm userForm = (UserForm) form;
		System.out.println("用户名=="+userForm.getUsername());
		System.out.println("密码=="+userForm.getPassword());
		
		String url = "fail";
		if(userForm.getUsername().equals("feng") &&
							userForm.getPassword().equals("123456")){
			url = "succes";
		}
		return forwardMap.get(url);
	}

	
	
}
